import Vue from 'vue'
import Vuex from 'vuex'

// 导入vuex模组
import login from "./modules/login.js"
import mySession from './modules/mySession.js'
import classify from "./modules/classify.js"
import detail from "./modules/detail.js"
import getters from './getters'
import user from "./modules/user.js"
import person from "./modules/person.js"
import session from "./modules/session.js"
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    //用户数据
    user:{},
    //底部导航显示
    showFootNav:false,
    //底部导航坐标
    foorNavActive:0
    
  },
  getters,
  mutations: {
    // 登录完成后调用此方法，将用户数据保存
    setUser(state,payload){
      state.user = payload
    },
    //用于设置底部导航显示
    setFootNavShow(state,boolen){
      state.showFootNav = boolen
      
    },
    // 设置底部导航坐标
    setFoorNavActive(state,number){
      state.foorNavActive = number
    }
  },
  actions: {
  },
  modules: {
    login,
    mySession,
    classify,
    detail,
    person,
    user,
    session
    
  }
})
